﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;


namespace SportsStore.Domain.Entities
{
    [MetadataType(typeof(ProductMetadataSource))]
    public partial class Product
    {
        
    }

    class  ProductMetadataSource
    {

        [HiddenInput(DisplayValue = false)]
        public int Id { get; set; }

        [Required(ErrorMessage = "Please enter a product name")]
        public string Name { get; set; }

        [Required(ErrorMessage = "Please enter a description")]
        [DataType(DataType.MultilineText)]
        public string Description { get; set; }

        [Required]
        [Range(0.01, double.MaxValue, ErrorMessage = "Please enter a positive price")]
        public decimal Price { get; set; }

        [Required(ErrorMessage = "Please specify a category")]
        public int CategoryId { get; set; }

        [Required]
        public byte Ranking { get; set; }

        //public byte[] ImageData { get; set; }  This has been changed to "ImageToShow"
        [Required]
        public int ImageToShow { get; set; }


        [HiddenInput(DisplayValue = false)]
        public string ImageMimeType { get; set; }
    }
}
